using System;
using System.IO;

class ReadTextFile {
    static void Main() {
        string filename = "example.txt"; // 记事本文件的路径

        try {
            using (StreamReader sr = new StreamReader(filename)) {
                string line;
                Console.WriteLine("File content:");
                while ((line = sr.ReadLine()) != null) {
                    Console.WriteLine(line);
                }
            }
        } catch (IOException e) {
            Console.WriteLine($"Error reading the file '{filename}': {e.Message}");
        }
    }
}